/*
 * io_device.h
 *
 *  Created on: Mar 4, 2012
 *
 *
 *	IO devices will only be activated by Sys calls.
 *
 *	One of these will wait a little bit, then generate an interrupt ( to signal IO is complete)
 *
 *	Notes:
 *	Ref to cpu to generate Interrupt
 *
 *
 *	IO Device data flow:
 *
 *	Input:
 *		Device initialized on program start
 *		Device always listening
 *		device produces interrupt whenever
 *
 *	Output:
 *		Called by CPU via trap / Syscall
 *		"loads" device with data
 *		device bullshits around for a bit
 *		device produces interrupt when done
 *
 *
 *
 */

#ifndef IO_DEVICE_H_
#define IO_DEVICE_H_
#include "../Utility/queue.h"
//#include "CPU/cpu.h";
//#include "System Timer/system_timer.h";

typedef struct{
	Queue my_interrupt_q;
	Queue my_blocked_q;
	int my_type;
	int trap;
} io_device;

int io_device_init(io_device* io_ptr, Queue interrupt_q, int the_type);

void  run_io(io_device* io_ptr);

#endif /* IO_DEVICE_H_ */
